home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5723 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  764 b 

  1. Path: news.microsoft.com!news
  2. From: a-cnadc@microsoft.com (Dann Corbit)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Tough Question: The summary of the summary
  5. Date: 20 Feb 1996 23:07:11 GMT
  6. Organization: Microsoft Corporation
  7. Message-ID: <4gdk6v$ojk@news.microsoft.com>
  8. References: <4gdho9$mll@news.microsoft.com>
  9. NNTP-Posting-Host: 157.57.171.202
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.93.14
  12.  
  13. Here is a summary of the timings for the methods that worked.
  14. Your mileage may vary.
  15.  
  16. direct lookup = {0 seconds} ( Yes, it was cheating, but it did fit the spec )
  17.  
  18. lastNonZeroDigitOfFactorial( n ) = {1 second}
  19.  
  20. rightmost_nonzero_digit( n ) = {8 seconds}
  21.  
  22. fact_lsd( n ) = {2 minutes 35 seconds}
  23.  
  24. factorial_lsd( n ) = {2 minutes 42 seconds}
  25.  
  26. foo( n ) = {3 minutes 31 seconds}
  27.  
  28.